
import { PrismaClient } from '@prisma/client'
import { NextResponse } from 'next/server';

const prisma = new PrismaClient()

export async function GET() {
  // 随机取0-136之间的数据，包含0和136
  const id = Math.floor(Math.random() * 44)

  console.log('id', id)

  const book =  await prisma.moonCard.findUnique({
    where: { id }
  })

  return NextResponse.json({ message: '获取成功', data: book, code: 0 }, { status: 200 });
}